"""Provides constants for Wallbox component tests."""

from homeassistant.components.wallbox.const import (
    CHARGER_ADDED_ENERGY_KEY,
    CHARGER_ADDED_RANGE_KEY,
    CHARGER_CHARGING_POWER_KEY,
    CHARGER_CHARGING_SPEED_KEY,
    CHARGER_CURRENCY_KEY,
    CHARGER_CURRENT_VERSION_KEY,
    CHARGER_DATA_KEY,
    CHARGER_ECO_SMART_KEY,
    CHARGER_ECO_SMART_MODE_KEY,
    CHARGER_ECO_SMART_STATUS_KEY,
    CHARGER_ENERGY_PRICE_KEY,
    CHARGER_FEATURES_KEY,
    CHARGER_LOCKED_UNLOCKED_KEY,
    CHARGER_MAX_AVAILABLE_POWER_KEY,
    CHARGER_MAX_CHARGING_CURRENT_KEY,
    CHARGER_MAX_ICP_CURRENT_KEY,
    CHARGER_NAME_KEY,
    CHARGER_PART_NUMBER_KEY,
    CHARGER_PLAN_KEY,
    CHARGER_POWER_BOOST_KEY,
    CHARGER_SERIAL_NUMBER_KEY,
    CHARGER_SOFTWARE_KEY,
    CHARGER_STATUS_ID_KEY,
)

JWT = "jwt"
USER_ID = "user_id"
TTL = "ttl"
REFRESH_TOKEN_TTL = "refresh_token_ttl"
ERROR = "error"
STATUS = "status"

WALLBOX_STATUS_RESPONSE = {
    CHARGER_CHARGING_POWER_KEY: 0,
    CHARGER_STATUS_ID_KEY: 193,
    CHARGER_MAX_AVAILABLE_POWER_KEY: 25.0,
    CHARGER_CHARGING_SPEED_KEY: 0,
    CHARGER_ADDED_RANGE_KEY: 150,
    CHARGER_ADDED_ENERGY_KEY: 44.697,
    CHARGER_NAME_KEY: "WallboxName",
    CHARGER_DATA_KEY: {
        CHARGER_MAX_CHARGING_CURRENT_KEY: 24,
        CHARGER_ENERGY_PRICE_KEY: 0.4,
        CHARGER_LOCKED_UNLOCKED_KEY: False,
        CHARGER_SERIAL_NUMBER_KEY: "20000",
        CHARGER_PART_NUMBER_KEY: "PLP1-0-2-4-9-002-E",
        CHARGER_SOFTWARE_KEY: {CHARGER_CURRENT_VERSION_KEY: "5.5.10"},
        CHARGER_CURRENCY_KEY: {"code": "EUR/kWh"},
        CHARGER_MAX_ICP_CURRENT_KEY: 20,
        CHARGER_PLAN_KEY: {CHARGER_FEATURES_KEY: [CHARGER_POWER_BOOST_KEY]},
        CHARGER_ECO_SMART_KEY: {
            CHARGER_ECO_SMART_STATUS_KEY: False,
            CHARGER_ECO_SMART_MODE_KEY: 0,
        },
    },
}

WALLBOX_STATUS_RESPONSE_BIDIR = {
    CHARGER_CHARGING_POWER_KEY: 0,
    CHARGER_STATUS_ID_KEY: 193,
    CHARGER_MAX_AVAILABLE_POWER_KEY: 25.0,
    CHARGER_CHARGING_SPEED_KEY: 0,
    CHARGER_ADDED_RANGE_KEY: 150,
    CHARGER_ADDED_ENERGY_KEY: 44.697,
    CHARGER_NAME_KEY: "WallboxName",
    CHARGER_DATA_KEY: {
        CHARGER_MAX_CHARGING_CURRENT_KEY: 24,
        CHARGER_ENERGY_PRICE_KEY: 0.4,
        CHARGER_LOCKED_UNLOCKED_KEY: False,
        CHARGER_SERIAL_NUMBER_KEY: "20000",
        CHARGER_PART_NUMBER_KEY: "QSP1-0-2-4-9-002-E",
        CHARGER_SOFTWARE_KEY: {CHARGER_CURRENT_VERSION_KEY: "5.5.10"},
        CHARGER_CURRENCY_KEY: {"code": "EUR/kWh"},
        CHARGER_MAX_ICP_CURRENT_KEY: 20,
        CHARGER_PLAN_KEY: {CHARGER_FEATURES_KEY: [CHARGER_POWER_BOOST_KEY]},
        CHARGER_ECO_SMART_KEY: {
            CHARGER_ECO_SMART_STATUS_KEY: False,
            CHARGER_ECO_SMART_MODE_KEY: 0,
        },
    },
}

WALLBOX_STATUS_RESPONSE_ECO_MODE = {
    CHARGER_CHARGING_POWER_KEY: 0,
    CHARGER_STATUS_ID_KEY: 193,
    CHARGER_MAX_AVAILABLE_POWER_KEY: 25.0,
    CHARGER_CHARGING_SPEED_KEY: 0,
    CHARGER_ADDED_RANGE_KEY: 150,
    CHARGER_ADDED_ENERGY_KEY: 44.697,
    CHARGER_NAME_KEY: "WallboxName",
    CHARGER_DATA_KEY: {
        CHARGER_MAX_CHARGING_CURRENT_KEY: 24,
        CHARGER_ENERGY_PRICE_KEY: 0.4,
        CHARGER_LOCKED_UNLOCKED_KEY: False,
        CHARGER_SERIAL_NUMBER_KEY: "20000",
        CHARGER_PART_NUMBER_KEY: "PLP1-0-2-4-9-002-E",
        CHARGER_SOFTWARE_KEY: {CHARGER_CURRENT_VERSION_KEY: "5.5.10"},
        CHARGER_CURRENCY_KEY: {"code": "EUR/kWh"},
        CHARGER_MAX_ICP_CURRENT_KEY: 20,
        CHARGER_PLAN_KEY: {CHARGER_FEATURES_KEY: [CHARGER_POWER_BOOST_KEY]},
        CHARGER_ECO_SMART_KEY: {
            CHARGER_ECO_SMART_STATUS_KEY: True,
            CHARGER_ECO_SMART_MODE_KEY: 0,
        },
    },
}


WALLBOX_STATUS_RESPONSE_FULL_SOLAR = {
    CHARGER_CHARGING_POWER_KEY: 0,
    CHARGER_STATUS_ID_KEY: 193,
    CHARGER_MAX_AVAILABLE_POWER_KEY: 25.0,
    CHARGER_CHARGING_SPEED_KEY: 0,
    CHARGER_ADDED_RANGE_KEY: 150,
    CHARGER_ADDED_ENERGY_KEY: 44.697,
    CHARGER_NAME_KEY: "WallboxName",
    CHARGER_DATA_KEY: {
        CHARGER_MAX_CHARGING_CURRENT_KEY: 24,
        CHARGER_ENERGY_PRICE_KEY: 0.4,
        CHARGER_LOCKED_UNLOCKED_KEY: False,
        CHARGER_SERIAL_NUMBER_KEY: "20000",
        CHARGER_PART_NUMBER_KEY: "PLP1-0-2-4-9-002-E",
        CHARGER_SOFTWARE_KEY: {CHARGER_CURRENT_VERSION_KEY: "5.5.10"},
        CHARGER_CURRENCY_KEY: {"code": "EUR/kWh"},
        CHARGER_MAX_ICP_CURRENT_KEY: 20,
        CHARGER_PLAN_KEY: {CHARGER_FEATURES_KEY: [CHARGER_POWER_BOOST_KEY]},
        CHARGER_ECO_SMART_KEY: {
            CHARGER_ECO_SMART_STATUS_KEY: True,
            CHARGER_ECO_SMART_MODE_KEY: 1,
        },
    },
}

WALLBOX_STATUS_RESPONSE_NO_POWER_BOOST = {
    CHARGER_CHARGING_POWER_KEY: 0,
    CHARGER_STATUS_ID_KEY: 193,
    CHARGER_MAX_AVAILABLE_POWER_KEY: 25.0,
    CHARGER_CHARGING_SPEED_KEY: 0,
    CHARGER_ADDED_RANGE_KEY: 150,
    CHARGER_ADDED_ENERGY_KEY: 44.697,
    CHARGER_NAME_KEY: "WallboxName",
    CHARGER_DATA_KEY: {
        CHARGER_MAX_CHARGING_CURRENT_KEY: 24,
        CHARGER_ENERGY_PRICE_KEY: 0.4,
        CHARGER_LOCKED_UNLOCKED_KEY: False,
        CHARGER_SERIAL_NUMBER_KEY: "20000",
        CHARGER_PART_NUMBER_KEY: "PLP1-0-2-4-9-002-E",
        CHARGER_SOFTWARE_KEY: {CHARGER_CURRENT_VERSION_KEY: "5.5.10"},
        CHARGER_CURRENCY_KEY: {"code": "EUR/kWh"},
        CHARGER_MAX_ICP_CURRENT_KEY: 20,
        CHARGER_PLAN_KEY: {CHARGER_FEATURES_KEY: []},
    },
}


WALLBOX_AUTHORISATION_RESPONSE = {
    "data": {
        "attributes": {
            "token": "fakekeyhere",
            "refresh_token": "refresh_fakekeyhere",
            USER_ID: 12345,
            TTL: 145656758,
            REFRESH_TOKEN_TTL: 145756758,
            ERROR: "false",
            STATUS: 200,
        }
    }
}


WALLBOX_AUTHORISATION_RESPONSE_UNAUTHORISED = {
    "data": {
        "attributes": {
            "token": "fakekeyhere",
            "refresh_token": "refresh_fakekeyhere",
            USER_ID: 12345,
            TTL: 145656758,
            REFRESH_TOKEN_TTL: 145756758,
            ERROR: "false",
            STATUS: 404,
        }
    }
}

WALLBOX_INVALID_REAUTH_RESPONSE = {
    "jwt": "fakekeyhere",
    "refresh_token": "refresh_fakekeyhere",
    "user_id": 12345,
    "ttl": 145656758,
    "refresh_token_ttl": 145756758,
    "error": False,
    "status": 200,
}


MOCK_NUMBER_ENTITY_ID = "number.wallbox_wallboxname_maximum_charging_current"
MOCK_NUMBER_ENTITY_ENERGY_PRICE_ID = "number.wallbox_wallboxname_energy_price"
MOCK_NUMBER_ENTITY_ICP_CURRENT_ID = "number.wallbox_wallboxname_maximum_icp_current"
MOCK_LOCK_ENTITY_ID = "lock.wallbox_wallboxname_lock"
MOCK_SENSOR_CHARGING_SPEED_ID = "sensor.wallbox_wallboxname_charging_speed"
MOCK_SENSOR_CHARGING_POWER_ID = "sensor.wallbox_wallboxname_charging_power"
MOCK_SENSOR_MAX_AVAILABLE_POWER = "sensor.wallbox_wallboxname_max_available_power"
MOCK_SWITCH_ENTITY_ID = "switch.wallbox_wallboxname_pause_resume"
MOCK_SELECT_ENTITY_ID = "select.wallbox_wallboxname_solar_charging"
